package net.huashitong.user.web;

import java.util.HashMap;
import java.util.Map;

import net.huashitong.user.filter.ApkVersionFilter;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sirdc.modules.core.web.JsonBaseController;
import com.sirdc.modules.core.web.model.Message;

@Controller
@RequestMapping("/app/apkVersion")
public class ApkVersionController extends JsonBaseController {

	private static final String URL = "http://10.23.193.13:81/downApp/ningde-release.apk";
	@Override
	protected String getView(String arg0) {
		// TODO Auto-generated method stub
		return null;
	}
	/**
	 * 版本号控制
	 * @param
	 * @return
	 */
	@ResponseBody
	@RequestMapping("/detailApkVersion")
	public Message detailApkVersion(@RequestBody ApkVersionFilter filter){
		if("1".equals(filter.getApkVersion())){
			return coverMessage("500", "无需更新");
		}
		Map<String, Object> map = new HashMap<String, Object>();
		StringBuffer str = new StringBuffer();
		str.append("1.sifjoas\n");
		str.append("2.sdjfoiasj\n");
		map.put("url", URL);
		map.put("string",str);
		return coverMessage("200", "有新版本请下载", map);
	}
}
